<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="container">
        <ul>
            <li class="text">lorem001</li>
            <li>lorem002</li>
            <li>lorem003</li>
            <li>lorem004</li>
        </ul>
        <ul>
            <li>lorem001</li>
            <li class="text">lorem002</li>
            <li>lorem003</li>
            <li>lorem004</li>
        </ul>
        <ul>
            <li class="text">lorem001</li>
            <li>lorem002</li>
            <li>lorem003</li>
            <li class="text">lorem004</li>
        </ul>
    </div>

    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.3/jquery.js"></script>
    <script>
        //===== jQuery的筛选 
        //在已有的jQuery对象里再进行筛选，
        //有点类似于dom当中通过关系获取节点的属性的作用

        //eq()
        $('li').eq(1).css('color', 'purple')
        // $('li:eq(2)').css('font-weight','900')

        //hasClass(class)
        let boo = $('li:last').hasClass('text');
        console.log(boo);

        // let boo2 = $('li:first').get(0).classList.contains('text');
        // console.log(boo2);

        //filter()

        // let s = $('li').filter('.text');
        // console.log(s);

        //children()

        // let children = $('.container>ul').children()
        // console.log(children);

    </script>

</body>

</html>